home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Python1.4_Source / Include / thread.h < prev    next >
C/C++ Source or Header  |  1998-06-24  |  1KB  |  52 lines

  1. #ifndef _THREAD_H_included
  2. #define _THREAD_H_included
  3.  
  4. #define NO_EXIT_PROG        /* don't define exit_prog() */
  5.                 /* (the result is no use of signals on SGI) */
  6.  
  7. #ifndef Py_PROTO
  8. #if defined(__STDC__) || defined(__cplusplus)
  9. #define Py_PROTO(args)    args
  10. #else
  11. #define Py_PROTO(args)    ()
  12. #endif
  13. #endif
  14.  
  15. typedef void *type_lock;
  16. typedef void *type_sema;
  17.  
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21.  
  22. void init_thread Py_PROTO((void));
  23. int start_new_thread Py_PROTO((void (*)(void *), void *));
  24. void exit_thread Py_PROTO((void));
  25. void _exit_thread Py_PROTO((void));
  26. long get_thread_ident Py_PROTO((void));
  27.  
  28. type_lock allocate_lock Py_PROTO((void));
  29. void free_lock Py_PROTO((type_lock));
  30. int acquire_lock Py_PROTO((type_lock, int));
  31. #define WAIT_LOCK    1
  32. #define NOWAIT_LOCK    0
  33. void release_lock Py_PROTO((type_lock));
  34.  
  35. type_sema allocate_sema Py_PROTO((int));
  36. void free_sema Py_PROTO((type_sema));
  37. int down_sema Py_PROTO((type_sema, int));
  38. #define WAIT_SEMA    1
  39. #define NOWAIT_SEMA    0
  40. void up_sema Py_PROTO((type_sema));
  41.  
  42. #ifndef NO_EXIT_PROG
  43. void exit_prog Py_PROTO((int));
  44. void _exit_prog Py_PROTO((int));
  45. #endif
  46.  
  47. #ifdef __cplusplus
  48. }
  49. #endif
  50.  
  51. #endif
  52.